<?php
/**
 * GioCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@ninhgio.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2010-2011 GioCMS (http://cms.ninhgio.com)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @author		NinhGio - ninhgio@gmail.com
 * @since		1.0
 */
?>
<div class="ninhgio g_utility_forecast g_widget mb5" id="<?php echo $this->unid; ?>">
	<div class="container">
		<div class="fl" style="width: 50%">
			<a href="javascript: void(0);" class="color2 bold fontsize15"><?php echo $this->TRANSLATOR->widget('title'); ?></a>
			<div class="pdt5">
				<img style="float: left;" alt="" src="<?php echo sprintf('%s/modules/%s/widgets/%s/css/images/g_utility_forecast_select_city.gif', $this->APP_STATIC_SERVER, $this->module, $this->widget); ?>" />
		           <select class="g_utility_forecast_city" name="weather">
		               <option value="Hanoi">Hà nội</option>
		               <option value="HCM">TP Hồ Chí Minh</option>
		               <option value="Sonla">Sơn La</option>
		               <option value="Haiphong">Hải Phòng</option>
		               <option value="Vinh">Vinh</option>
		               <option value="Danang">Đà Nẵng</option>
		               <option value="Nhatrang">Nha trang</option>
		               <option value="Pleicu">Pleiku</option>
		           </select>
				<div class="clear"></div>
				<div class="g_content pdt5"></div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="fl gold" style="width: 50%">
			<!--  -->
			<a class="color2 bold fontsize15" href="javascript: void(0);">Giá vàng</a>
			<div class="boxCt">
				<div align="right" style="font-size: 10px; color: rgb(54, 118, 186);">ĐVT: tr.đồng/lượng</div>
				<table width="160" cellspacing="1" cellpadding="2" border="0" align="center" class="marketInfo">
					<tbody>
						<tr>
							<td>Loại</td>
							<td>Mua</td>
							<td>Bán</td>
						</tr>
						<script src="http://vnexpress.net/Service/Gold_Content.js" language="JavaScript" type="text/javascript"></script>
						<script language="JavaScript" type="text/javascript">
							document.write("<tr><td>SBJ</td><td>" + vGoldSbjBuy + "</td><td>" + vGoldSbjSell + "</td></tr>");
							document.write("<tr><td>SJC</td><td>" + vGoldSjcBuy + "</td><td>" + vGoldSjcSell + "</td></tr>");
						</script>
					</tbody>
				</table>
				<div style="font-size: 10px; padding: 5px 0pt;"><em>Nguồn: Sacombank</em></div>
			</div>
			<a class="color2 bold fontsize15" href="javascript: void(0);">Tỷ giá</a>
			<div style="height: 59px; overflow: auto;" class="boxCt">
				<script src="http://vnexpress.net/Service/Forex_Content.js" language="JavaScript" type="text/javascript"></script>
				<table width="140" cellspacing="1" cellpadding="2" border="0" align="center" class="marketInfo">
					<script language="JavaScript" type="text/javascript">
						document.write("<tr><td align='Left'>" + vForexs[0] + " </td><td align=right>" + vCosts[0] + " </td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[1] + " </td><td align=right>" + vCosts[1] + " </td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[2] + " </td><td align=right>" + vCosts[2] + "</td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[3] + " </td><td align=right> " + vCosts[3] + "</td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[4] + "</td><td align=right> " + vCosts[4] + "</td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[5] + "</td><td align=right> " + vCosts[5] + "</td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[6] + "</td><td align=right> " + vCosts[6] + "</td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[7] + " </td><td align=right> " + vCosts[7] + "</td></tr>");
						document.write("<tr><td align='Left'>" + vForexs[8] + "</td><td align=right>" + vCosts[8] + "</td></tr>");
					</script>
				</table>
			</div>
			<!--  -->
		</div>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
	var url = 'http://vnexpress.net/ListFile/Weather/';
	var container  = $('#<?php echo $this->unid; ?>').find('.g_content:first');
	$('#<?php echo $this->unid; ?>').find('.g_utility_forecast_city:first').bind('change', function() {
		var vneURL = url + this.value + '.xml';
		var params = 'city_url=' + vneURL;
		Gio.Core.Widget.Loader.baseUrl = '<?php echo $this->url('core_widget_ajax'); ?>';
		Gio.Core.Widget.Loader.cacheEnable = '<?php if ($this->cacheEnable) : ?>true<?php else : ?>false<?php endif; ?>';
		Gio.Core.Widget.Loader.cacheTimeout = '<?php if ($this->cacheTimeout) : ?><?php echo $this->cacheTimeout; ?><?php else : ?>false<?php endif; ?>';
		Gio.Core.Widget.Loader.queueAction('<?php echo $this->module; ?>', '<?php echo $this->widget; ?>', 'load', params, $(container), null);
	}).change();
});
</script>